package cn.j229.bug.zhongxuan.eureka_service_feign_hystrix.controller;

import cn.j229.bug.zhongxuan.eureka_service_feign_hystrix.service.UserHandlerService;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @Author smile_ZhongXuan
 * @Date 2020/10/29 16:11
 * @Version 1.0
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    UserHandlerService userHandlerService = null;

    /*
    这里类似于ribbon，提供一个对外访问的接口地址，
    然后根据serviceFeignByShow接口来决定调用哪一个子模块服务和哪一个接口地址
     */
    @RequestMapping(value = "/get",method = RequestMethod.GET,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public Map get() {
        return userHandlerService.get();
    }
}
